package ua.cs.stu.ics.GUI;

import org.apache.log4j.Logger;
import ua.cs.stu.ics.dao.dbf.MarkNewDAO;
import ua.cs.stu.ics.dao.dbf.SpecialityDAO;
import ua.cs.stu.ics.dao.dbf.StudentDAO;
import ua.cs.stu.ics.dbf.domain.SpecialityDomain;
import ua.cs.stu.ics.dbf.domain.StudentDomain;
import ua.cs.stu.ics.label.JLabelExtended;
import ua.cs.stu.ics.utils.Util;

import javax.swing.*;
import java.awt.*;
import java.text.DateFormat;
import java.text.FieldPosition;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;

/**
 * Created by IntelliJ IDEA. User: Admin Date: 27.02.11 Time: 23:37 To change
 * this template use File | Settings | File Templates.
 */
public class FirstBlankView {

	private static final int DOC_WIDTH = 20;
	private static final int ACADEMIC_WIDTH = 40;
	private static final int DIRECTION_WIDTH = 15;
	private static final int PROF_WIDTH = 35;
	private static final int PROGRAM_WIDTH = 30;
	private static final int SPECIAL_WIDTH = 23;
	private static final int PERIOD_WIDTH = 35;
	private static final int TEMA_WIDTH = 50;

	private JLabelExtended jLabelSpecial1 = null;
	private JLabelExtended jLabelSpecial2 = null;
	private JLabelExtended jLabelDerzhIsp1 = null;
	private JLabelExtended jLabelDerzhIsp3 = null;
	private JLabelExtended jLabelMark1 = null;
	private JLabelExtended jLabelMark2 = null;
	private JLabelExtended jLabelMark3 = null;
	private JLabelExtended jLabelQualification = null;
	private JLabelExtended jLabelGolova = null;
	private JLabelExtended jLabel7 = null;
	private JLabelExtended jLabel8 = null;
	private JLabelExtended jLabelDayOut = null;
	private JLabelExtended jLabelMonthOut = null;
	private JLabelExtended jLabelYearOut = null;
	private JLabelExtended jLabel12 = null;
	private JLabelExtended jLabel13 = null;
	private JLabelExtended jLabelConditions = null;
	private JLabelExtended jLabelVum1 = null;
	private JLabelExtended jLabelVum2 = null;
	private JLabelExtended jLabelVum3 = null;
	private JLabelExtended jLabel16 = null;
	private JLabelExtended jLabel17 = null;
	private JLabelExtended jLabel18 = null;
	private JLabelExtended jLabel19 = null;
	private JLabelExtended jLabel20 = null;
	private JLabelExtended jLabel21 = null;
	private JLabelExtended jLabelSurname = null;
	private JLabelExtended jLabelName = null;
	private JLabelExtended jLabelBirthDay = null;
	private JLabelExtended jLabelLastEduc1 = null;
	private JLabelExtended jLabelLastEduc2 = null;
	private JLabelExtended jLabelLastEduc3 = null;
	private JLabelExtended jLabel27 = null;
	private JLabelExtended jLabel28 = null;
	private JLabelExtended jLabelTypeProg1 = null;
	private JLabelExtended jLabelTypeProg2 = null;
	private JLabelExtended jLabelTermin = null;
	private JLabelExtended jLabelForma = null;
	private JLabelExtended jLabelDirection1 = null;
	private JLabelExtended jLabelDirection2 = null;
	private JLabelExtended jLabelPrakt1 = null;
	private JLabelExtended jLabelPrakt2 = null;
	private JLabelExtended jLabelPrakt3 = null;
	private JLabelExtended jLabelAcademic1 = null;
	private JLabelExtended jLabelAcademic2 = null;
	private JLabelExtended jLabelAcademic3 = null;
	private JLabelExtended jLabelProf1 = null;
	private JLabelExtended jLabelProf2 = null;
	private JLabelExtended jLabelProf3 = null;
	private JLabelExtended jLabelDateIn = null;
	private JLabelExtended jLabelDateOut = null;
	private JLabelExtended jLabelSumma = null;
	private JLabelExtended jLabelDiplom = null;
	private JLabelExtended jLabelDerzhIsp2 = null;
	private JLabelExtended jLabelTema1 = null;
	private JLabelExtended jLabelTema2 = null;
	private JLabelExtended jLabelTema3 = null;
	private JLabelExtended jLabelTema4 = null;
	private JLabelExtended jLabelMarkDiplom = null;
	private JLabelExtended jLabelMarkD = null;
	private JLabelExtended jLabelDay = null;
	private JLabelExtended jLabelMonth = null;
	private JLabelExtended jLabelYear = null;
	private JLabelExtended jLabelTimeVuk = null;
	private JLabelExtended jLabelTimeV = null;

	public FirstBlankView() {
	}

	private ImagePanel jPanel;
	private StudentDAO studentDAO;
	private SpecialityDAO specialityDAO;
	private MarkNewDAO markNewDAO;

	public MarkNewDAO getMarkNewDAO() {
		return markNewDAO;
	}

	public void setMarkNewDAO(MarkNewDAO markNewDAO) {
		this.markNewDAO = markNewDAO;
	}

	public SpecialityDAO getSpecialityDAO() {
		return specialityDAO;
	}

	public void setSpecialityDAO(SpecialityDAO specialityDAO) {
		this.specialityDAO = specialityDAO;
	}

	public void setjPanel(ImagePanel jPanel) {
		this.jPanel = jPanel;
	}

	public void setStudentDAO(StudentDAO studentDAO) {
		this.studentDAO = studentDAO;
	}

	public ImagePanel create(String image) {
		jLabelMark3 = new JLabelExtended();
		jLabelMark3.setBounds(new Rectangle(231, 206, 38, 16));
		jLabelMark3.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelMark3.setHorizontalAlignment(SwingConstants.CENTER);
		jLabelMark3.setName("jLabelMark3");

		jLabelDerzhIsp2 = new JLabelExtended();
		jLabelDerzhIsp2.setBounds(new Rectangle(54, 189, 159, 16));
		jLabelDerzhIsp2.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelDerzhIsp2.setName("jLabelDerzhIsp2");

		jLabelTema1 = new JLabelExtended();
		jLabelTema1.setBounds(new Rectangle(62, 64, 222, 11));
		jLabelTema1.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelTema1.setName("jLabelTema1");

		jLabelTema2 = new JLabelExtended();
		jLabelTema2.setBounds(new Rectangle(62, 79, 222, 11));
		jLabelTema2.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelTema2.setName("jLabelTema2");

		jLabelTema3 = new JLabelExtended();
		jLabelTema3.setBounds(new Rectangle(62, 95, 222, 11));
		jLabelTema3.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelTema3.setName("jLabelTema3");

		jLabelTema4 = new JLabelExtended();
		jLabelTema4.setBounds(new Rectangle(62, 113, 222, 11));
		jLabelTema4.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelTema4.setName("jLabelTema4");

		jLabelDerzhIsp3 = new JLabelExtended();
		jLabelDerzhIsp3.setBounds(new Rectangle(54, 206, 159, 16));
		jLabelDerzhIsp3.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelDerzhIsp3.setName("jLabelDerzhIsp3");

		jLabelDiplom = new JLabelExtended();
		jLabelDiplom.setBounds(new Rectangle(632, 218, 130, 10));
		jLabelDiplom.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelDiplom.setName("jLabelDiplom");

		jLabelSumma = new JLabelExtended();
		jLabelSumma.setBounds(new Rectangle(509, 280, 33, 10));
		jLabelSumma.setName("jLabelSumma");
		jLabelSumma.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelDateOut = new JLabelExtended();
		jLabelDateOut.setBounds(new Rectangle(626, 482, 100, 10));
		jLabelDateOut.setName("jLabelDateOut");
		jLabelDateOut.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelDateIn = new JLabelExtended();
		jLabelDateIn.setBounds(new Rectangle(621, 468, 100, 10));
		jLabelDateIn.setName("jLabelDateIn");
		jLabelDateIn.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelProf2 = new JLabelExtended();
		jLabelProf2.setBounds(new Rectangle(577, 441, 231, 10));
		jLabelProf2.setName("jLabelProf2");
		jLabelProf2.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelProf1 = new JLabelExtended();
		jLabelProf1.setBounds(new Rectangle(641, 430, 160, 10));
		jLabelProf1.setName("jLabelProf1");
		jLabelProf1.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelProf3 = new JLabelExtended();
		jLabelProf3.setBounds(new Rectangle(577, 456, 229, 10));
		jLabelProf3.setName("jLabelProf3");
		jLabelProf3.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelAcademic3 = new JLabelExtended();
		jLabelAcademic3.setBounds(new Rectangle(578, 416, 214, 10));
		jLabelAcademic3.setName("jLabelAcademic3");
		jLabelAcademic3.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelAcademic2 = new JLabelExtended();
		jLabelAcademic2.setBounds(new Rectangle(577, 402, 223, 10));
		jLabelAcademic2.setName("jLabelAcademic2");
		jLabelAcademic2.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelAcademic1 = new JLabelExtended();
		jLabelAcademic1.setBounds(new Rectangle(649, 390, 146, 10));
		jLabelAcademic1.setName("jLabelAcademic1");
		jLabelAcademic1.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelPrakt1 = new JLabelExtended();
		jLabelPrakt1.setBounds(new Rectangle(650, 350, 150, 10));
		jLabelPrakt1.setName("jLabelPrakt1");
		jLabelPrakt1.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelPrakt2 = new JLabelExtended();
		jLabelPrakt2.setBounds(new Rectangle(577, 363, 227, 10));
		jLabelPrakt2.setName("jLabelPrakt2");
		jLabelPrakt2.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelPrakt3 = new JLabelExtended();
		jLabelPrakt3.setBounds(new Rectangle(577, 376, 227, 10));
		jLabelPrakt3.setName("jLabelPrakt3");
		jLabelPrakt3.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelDirection1 = new JLabelExtended();
		jLabelDirection1.setBounds(new Rectangle(696, 298, 105, 10));
		jLabelDirection1.setName("jLabelDirection1");
		jLabelDirection1.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelDirection2 = new JLabelExtended();
		jLabelDirection2.setBounds(new Rectangle(577, 309, 210, 10));
		jLabelDirection2.setName("jLabelDirection2");
		jLabelDirection2.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelSpecial1 = new JLabelExtended();
		jLabelSpecial1.setBounds(new Rectangle(630, 322, 170, 10));
		jLabelSpecial1.setName("jLabelSpecial1");
		jLabelSpecial1.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelSpecial2 = new JLabelExtended();
		jLabelSpecial2.setBounds(new Rectangle(577, 335, 220, 10));
		jLabelSpecial2.setName("jLabelSpecial2");
		jLabelSpecial2.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelForma = new JLabelExtended();
		jLabelForma.setBounds(new Rectangle(652, 283, 83, 10));
		jLabelForma.setName("jLabelForma");
		jLabelForma.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelTermin = new JLabelExtended();
		jLabelTermin.setBounds(new Rectangle(639, 271, 147, 10));
		jLabelTermin.setName("jLabelTermin");
		jLabelTermin.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelTypeProg1 = new JLabelExtended();
		jLabelTypeProg1.setBounds(new Rectangle(647, 245, 156, 10));
		jLabelTypeProg1.setName("jLabelTypeProg1");
		jLabelTypeProg1.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelTypeProg2 = new JLabelExtended();
		jLabelTypeProg2.setBounds(new Rectangle(577, 256, 210, 10));
		jLabelTypeProg2.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelTypeProg2.setName("jLabelTypeProg2");

		jLabel28 = new JLabelExtended();
		jLabel28.setBounds(new Rectangle(577, 192, 108, 10));
		jLabel28.setText("технологічний університет");
		jLabel28.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel28.setName("jLabel28");
		jLabel28.setFromDatabase(false);

		jLabelTimeVuk = new JLabelExtended();
		jLabelTimeVuk.setBounds(new Rectangle(60, 130, 60, 11));
		jLabelTimeVuk.setText("");
		jLabelTimeVuk.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelTimeVuk.setName("jLabelTimeVuk");
		jLabelTimeVuk.setFromDatabase(false);

		jLabelTimeV = new JLabelExtended();
		jLabelTimeV.setBounds(new Rectangle(125, 130, 80, 11));
		jLabelTimeV.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelTimeV.setName("jLabelTimeV");

		jLabelMarkDiplom = new JLabelExtended();
		jLabelMarkDiplom.setBounds(new Rectangle(220, 130, 30, 11));
		jLabelMarkDiplom.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelMarkDiplom.setName("jLabelMarkDiplom ");
		jLabelMarkDiplom.setText("");
		jLabelMarkDiplom.setFromDatabase(false);

		jLabelMarkD = new JLabelExtended();
		jLabelMarkD.setBounds(new Rectangle(255, 130, 10, 14));
		jLabelMarkD.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelMarkD.setName("jLabelMarkD");

		jLabel27 = new JLabelExtended();
		jLabel27.setBounds(new Rectangle(675, 178, 112, 10));
		jLabel27.setText("Чернігівський державний");
		jLabel27.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel27.setName("jLabel27");
		jLabel27.setFromDatabase(false);

		jLabelLastEduc1 = new JLabelExtended();
		jLabelLastEduc1.setBounds(new Rectangle(687, 137, 114, 10));
		jLabelLastEduc1.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelLastEduc1.setName("jLabelLastEduc1");

		jLabelLastEduc2 = new JLabelExtended();
		jLabelLastEduc2.setBounds(new Rectangle(577, 151, 217, 10));
		jLabelLastEduc2.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelLastEduc2.setName("jLabelLastEduc2");

		jLabelLastEduc3 = new JLabelExtended();
		jLabelLastEduc3.setBounds(new Rectangle(577, 165, 217, 10));
		jLabelLastEduc3.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelLastEduc3.setName("jLabelLastEduc3");

		jLabelBirthDay = new JLabelExtended();
		jLabelBirthDay.setBounds(new Rectangle(649, 128, 100, 8));
		jLabelBirthDay.setHorizontalAlignment(SwingConstants.CENTER);
		jLabelBirthDay.setName("jLabelBirthDay");
		jLabelBirthDay.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelName = new JLabelExtended();
		jLabelName.setBounds(new Rectangle(640, 99, 165, 10));
		jLabelName.setHorizontalAlignment(SwingConstants.CENTER);
		jLabelName.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelName.setName("jLabelName");

		jLabelSurname = new JLabelExtended();
		jLabelSurname.setBounds(new Rectangle(633, 85, 159, 10));
		jLabelSurname.setHorizontalAlignment(SwingConstants.CENTER);
		jLabelSurname.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelSurname.setName("jLabelSurname");

		jLabel21 = new JLabelExtended();
		jLabel21.setBounds(new Rectangle(318, 448, 141, 10));
		jLabel21.setText("\"відмінно\", \"добре\",\"задовільно\"");
		jLabel21.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel21.setFromDatabase(false);
		jLabel21.setName("jLabel21");

		jLabel20 = new JLabelExtended();
		jLabel20.setBounds(new Rectangle(365, 436, 187, 10));
		jLabel20.setText("Якісна система оцінок. Для іспитів та заліків - ");
		jLabel20.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel20.setFromDatabase(false);
		jLabel20.setName("jLabel20");

		jLabel19 = new JLabelExtended();
		jLabel19.setBounds(new Rectangle(379, 340, 115, 10));
		jLabel19.setText("Семестрові іспити та заліки.");
		jLabel19.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel19.setFromDatabase(false);
		jLabel19.setName("jLabel19");

		jLabel18 = new JLabelExtended();
		jLabel18.setBounds(new Rectangle(318, 280, 187, 10));
		jLabel18.setText("Мінімальне навчальне навантаження(годин) -");
		jLabel18.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel18.setFromDatabase(false);
		jLabel18.setName("jLabel18");

		jLabel17 = new JLabelExtended();
		jLabel17.setBounds(new Rectangle(318, 268, 182, 10));
		jLabel17.setText("Система навчального року - двосеместрова.");
		jLabel17.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel17.setFromDatabase(false);
		jLabel17.setName("jLabel17");

		jLabel16 = new JLabelExtended();
		jLabel16.setBounds(new Rectangle(411, 255, 121, 10));
		jLabel16.setText("Облік в академічних годинах");
		jLabel16.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel16.setFromDatabase(false);
		jLabel16.setName("jLabel16");

		jLabelVum1 = new JLabelExtended();
		jLabelVum1.setBounds(new Rectangle(320, 205, 230, 10));
		jLabelVum1.setName("jLabelVum1");
		jLabelVum1.setFont(new Font("Dialog", Font.PLAIN, 8));
		
		jLabelVum2 = new JLabelExtended();
		jLabelVum2.setBounds(new Rectangle(320, 218, 230, 10));
		jLabelVum2.setName("jLabelVum2");
		jLabelVum2.setFont(new Font("Dialog", Font.PLAIN, 8));
		
		jLabelVum3 = new JLabelExtended();
		jLabelVum3.setBounds(new Rectangle(320, 231, 230, 10));
		jLabelVum3.setName("jLabelVum3");
		jLabelVum3.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelConditions = new JLabelExtended();
		jLabelConditions.setBounds(new Rectangle(317, 131, 231, 10));
		jLabelConditions.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelConditions.setName("jLabelConditions");

		jLabel13 = new JLabelExtended();
		jLabel13.setBounds(new Rectangle(324, 71, 77, 10));
		jLabel13.setText("рівня акредитації");
		jLabel13.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel13.setFromDatabase(false);
		jLabel13.setName("jLabel13");

		jLabel12 = new JLabelExtended();
		jLabel12.setBounds(new Rectangle(396, 58, 143, 10));
		jLabel12.setText("державний університет четвертого");
		jLabel12.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel12.setFromDatabase(false);
		jLabel12.setName("jLabel12");

		jLabelYearOut = new JLabelExtended();
		jLabelYearOut.setBounds(new Rectangle(150, 483, 11, 10));
		jLabelYearOut.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelYearOut.setName("jLabelYearOut");

		jLabelMonthOut = new JLabelExtended();
		jLabelMonthOut.setBounds(new Rectangle(100, 483, 29, 10));
		jLabelMonthOut.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelMonthOut.setName("jLabelMonthOut");

		jLabelDayOut = new JLabelExtended();
		jLabelDayOut.setBounds(new Rectangle(73, 483, 15, 10));
		jLabelDayOut.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelDayOut.setName("jLabelDayOut");

		jLabel8 = new JLabelExtended();
		jLabel8.setBounds(new Rectangle(91, 459, 42, 10));
		jLabel8.setText("Чернігів");
		jLabel8.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel8.setFromDatabase(false);
		jLabel8.setName("jLabel8");

		jLabel7 = new JLabelExtended();
		jLabel7.setBounds(new Rectangle(223, 443, 64, 10));
		jLabel7.setText("С.М. Шкарлет");
		jLabel7.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabel7.setFromDatabase(false);
		jLabel7.setName("jLabel7");

		jLabelGolova = new JLabelExtended();
		jLabelGolova.setBounds(new Rectangle(223, 420, 63, 10));
		jLabelGolova.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelGolova.setName("jLabelGolova");

		jLabelQualification = new JLabelExtended();
		jLabelQualification.setBounds(new Rectangle(59, 353, 141, 10));
		jLabelQualification.setName("jLabelQualification");
		jLabelQualification.setFont(new Font("Dialog", Font.PLAIN, 8));

		jLabelYear = new JLabelExtended();
		jLabelYear.setBounds(new Rectangle(133, 335, 14, 10));
		jLabelYear.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelYear.setName("jLabelYear");

		jLabelDay = new JLabelExtended();
		jLabelDay.setBounds(new Rectangle(75, 335, 10, 10));
		jLabelDay.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelDay.setName("jLabelDay");

		jLabelMonth = new JLabelExtended();
		jLabelMonth.setBounds(new Rectangle(90, 335, 38, 10));
		jLabelMonth.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelMonth.setHorizontalAlignment(SwingConstants.CENTER);
		jLabelMonth.setName("jLabelMonth ");

		jLabelMark1 = new JLabelExtended();
		jLabelMark1.setBounds(new Rectangle(231, 173, 38, 16));
		jLabelMark1.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelMark1.setHorizontalAlignment(SwingConstants.CENTER);
		jLabelMark1.setName("jLabelMark1");

		jLabelDerzhIsp1 = new JLabelExtended();
		jLabelDerzhIsp1.setBounds(new Rectangle(65, 174, 148, 16));
		jLabelDerzhIsp1.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelDerzhIsp1.setName("jLabelDerzhIsp1");

		jLabelMark2 = new JLabelExtended();
		jLabelMark2.setBounds(new Rectangle(231, 189, 38, 16));
		jLabelMark2.setFont(new Font("Dialog", Font.PLAIN, 8));
		jLabelMark2.setHorizontalAlignment(SwingConstants.CENTER);
		jLabelMark2.setName("jLabelMark2");

		jPanel = new ImagePanel(image);

		jPanel.setLayout(null);
		jPanel.setSize(new Dimension(842, 595));
		jPanel.setLocation(new Point(5, 5));
		jPanel.add(jLabelDerzhIsp1, null);
		jPanel.add(jLabelMark1, null);
		jPanel.add(jLabelMark2, null);
		jPanel.add(jLabelMark3, null);
		jPanel.add(jLabelMonth, null);
		jPanel.add(jLabelDay, null);
		jPanel.add(jLabelYear, null);
		jPanel.add(jLabelQualification, null);
		jPanel.add(jLabelGolova, null);
		jPanel.add(jLabel7, null);
		jPanel.add(jLabel8, null);
		jPanel.add(jLabelDayOut, null);
		jPanel.add(jLabelMonthOut, null);
		jPanel.add(jLabelYearOut, null);
		jPanel.add(jLabel12, null);
		jPanel.add(jLabel13, null);
		jPanel.add(jLabelConditions, null);
		jPanel.add(jLabelVum1, null);
		jPanel.add(jLabelVum2, null);
		jPanel.add(jLabelVum3, null);
		jPanel.add(jLabel16, null);
		jPanel.add(jLabel17, null);
		jPanel.add(jLabel18, null);
		jPanel.add(jLabel19, null);
		jPanel.add(jLabel20, null);
		jPanel.add(jLabel21, null);
		jPanel.add(jLabelSurname, null);
		jPanel.add(jLabelName, null);
		jPanel.add(jLabelBirthDay, null);
		jPanel.add(jLabelLastEduc1, null);
		jPanel.add(jLabelLastEduc2, null);
		jPanel.add(jLabelLastEduc3, null);
		jPanel.add(jLabel27, null);
		jPanel.add(jLabel28, null);
		jPanel.add(jLabelTypeProg1, null);
		jPanel.add(jLabelTypeProg2, null);
		jPanel.add(jLabelTermin, null);
		jPanel.add(jLabelForma, null);
		jPanel.add(jLabelDirection1, null);
		jPanel.add(jLabelDirection2, null);
		jPanel.add(jLabelSpecial1, null);
		jPanel.add(jLabelSpecial2, null);
		jPanel.add(jLabelPrakt1, null);
		jPanel.add(jLabelPrakt2, null);
		jPanel.add(jLabelPrakt3, null);
		jPanel.add(jLabelAcademic1, null);
		jPanel.add(jLabelAcademic2, null);
		jPanel.add(jLabelAcademic3, null);
		jPanel.add(jLabelProf1, null);
		jPanel.add(jLabelProf2, null);
		jPanel.add(jLabelProf3, null);
		jPanel.add(jLabelDateIn, null);
		jPanel.add(jLabelDateOut, null);
		jPanel.add(jLabelSumma, null);
		jPanel.add(jLabelDiplom, null);
		jPanel.add(jLabelDerzhIsp2, null);
		jPanel.add(jLabelDerzhIsp3, null);
		jPanel.add(jLabelTema1, null);
		jPanel.add(jLabelTema2, null);
		jPanel.add(jLabelTema3, null);
		jPanel.add(jLabelTema4, null);
		jPanel.add(jLabelMarkDiplom, null);
		jPanel.add(jLabelMarkD, null);
		jPanel.add(jLabelTimeVuk, null);
		jPanel.add(jLabelTimeV, null);

		return jPanel;
	}

	public void init() {
		jLabelLastEduc1.setText("");
		jLabelLastEduc2.setText("");
		jLabelLastEduc3.setText("");
		jLabelQualification.setText("");
		jLabelConditions.setText("");
		jLabelMark1.setText("");
		jLabelMark2.setText("");
		jLabelMark3.setText("");
		jLabelSurname.setText("");
		jLabelName.setText("");
		jLabelBirthDay.setText("");
		jLabelDiplom.setText("");
		jLabelSpecial1.setText("");
		jLabelDirection1.setText("");
		jLabelDerzhIsp1.setText("");
		jLabelDerzhIsp2.setText("");
		jLabelDerzhIsp3.setText("");
		jLabelGolova.setText("");
		jLabelVum1.setText("");
		jLabelVum2.setText("");
		jLabelVum3.setText("");
		jLabelSumma.setText("");
		jLabelDiplom.setText("");
		jLabelTypeProg1.setText("");
		jLabelTermin.setText("");
		jLabelForma.setText("");
		jLabelPrakt1.setText("");
		jLabelAcademic1.setText("");
		jLabelProf1.setText("");
		jLabelDateIn.setText("");
		jLabelDateOut.setText("");
		jLabelTema1.setText("");
		jLabelTema2.setText("");
		jLabelTema3.setText("");
		jLabelTema4.setText("");
		jLabelMarkD.setText("");
		jLabelDay.setText("");
		jLabelMonth.setText("");
		jLabelYear.setText("");
		jLabelDayOut.setText("");
		jLabelMonthOut.setText("");
		jLabelYearOut.setText("");
		jLabelTimeV.setText("");
	}

	public void edit(String name) {
		init();
		StudentDomain sd = studentDAO.findStudent(name);
		String spec = sd.getSpec();
		SpecialityDomain sc = specialityDAO.findCodeSpec(spec);
		
		Locale l = new Locale ("uk", "UA");
		
		jLabelQualification.setText(sc.getQualif().trim());
		jLabelConditions.setText(sd.getUslpostup().trim());
		jLabelMark1.setText(sd.getDerjmark1().trim());
		jLabelMark2.setText(sd.getDerjmark2().trim());
		jLabelMark3.setText(sd.getDerjmark3().trim());
		jLabelSurname.setText(sd.getFam().trim());
		jLabelName.setText(sd.getImq().trim() + " " + sd.getOt().trim());
		jLabelBirthDay.setText(DateFormat.getDateInstance(DateFormat.LONG, l).format(sd.getDr())+ " p.");

		String special = sc.getSpecializa().trim();
		String nap = sc.getNapram().trim();
		if (special.equals("-")) {
			special = "";
		}
		if (nap.equals("-")) {
			nap = "";
		}

		jLabelDiplom.setText(sc.getNamedip().trim());
		jLabelDerzhIsp1.setText(sc.getDergispit1().trim());
		jLabelDerzhIsp2.setText(sc.getDergispit2().trim());
		jLabelDerzhIsp3.setText(sc.getDergispit3().trim());
		jLabelGolova.setText(sc.getGolova().trim());
		jLabelSumma.setText(Integer.toString(markNewDAO.getSumTime(sd)));
		jLabelDiplom.setText(sc.getNamedip().trim());

		jLabelTermin.setText(sc.getTimenav().trim());
		jLabelForma.setText(sc.getForma().trim());



		jLabelDateIn.setText(DateFormat.getDateInstance(DateFormat.LONG, l).format(sd.getDatein())+ " p.");
		jLabelDateOut.setText(DateFormat.getDateInstance(DateFormat.LONG, l).format(sc.getDateout())+ " p.");
				
		jLabelMarkD.setText(sd.getMarkdip());

		ArrayList<String> tema = Util.trimToArray(sd.getTema().trim(),
				TEMA_WIDTH);
		ArrayList<String> vumog = Util.trimToArray(sc.getProgvum().trim(),
				TEMA_WIDTH);
		ArrayList<String> specializ = Util.trimToArray(special, SPECIAL_WIDTH);
		ArrayList<String> napr = Util.trimToArray(nap, DIRECTION_WIDTH);

		ArrayList<String> doc = Util.trimToArray(sd.getPredocname().trim()
				+ " " + sd.getPredocnum().trim(), DOC_WIDTH);
		ArrayList<String> program = Util.trimToArray(sc.getTipprogram().trim(),
				PROGRAM_WIDTH);
		ArrayList<String> period = Util.trimToArray(sc.getTimeprakt().trim(),
				PERIOD_WIDTH);
		ArrayList<String> academic = Util.trimToArray(sc.getAkright().trim(),
				ACADEMIC_WIDTH);
		ArrayList<String> prof = Util.trimToArray(sc.getProfright().trim(),
				PROF_WIDTH);

		try {
			jLabelVum1.setText(vumog.get(0));
			jLabelVum2.setText(vumog.get(1));
			jLabelVum3.setText(vumog.get(2));
			} catch (IndexOutOfBoundsException e) {

		}
		try {
			jLabelTema1.setText(tema.get(0));
			jLabelTema2.setText(tema.get(1));
			jLabelTema3.setText(tema.get(2));
			jLabelTema4.setText(tema.get(3));
		} catch (IndexOutOfBoundsException e) {

		}
		try {
			jLabelProf1.setText(prof.get(0));
			jLabelProf2.setText(prof.get(1));
			jLabelProf3.setText(prof.get(2));
		} catch (IndexOutOfBoundsException e) {

		}
		try {
			jLabelAcademic1.setText(academic.get(0));
			jLabelAcademic2.setText(academic.get(1));
			jLabelAcademic3.setText(academic.get(2));
		} catch (IndexOutOfBoundsException e) {

		}
		try {
			jLabelPrakt1.setText(period.get(0));
			jLabelPrakt2.setText(period.get(1));
			jLabelPrakt3.setText(period.get(2));
		} catch (IndexOutOfBoundsException e) {

		}
		try {
			jLabelTypeProg1.setText(program.get(0));
			jLabelTypeProg2.setText(program.get(1));
		} catch (IndexOutOfBoundsException e) {

		}
		try {
			jLabelDirection1.setText(napr.get(0));
			jLabelDirection2.setText(napr.get(1));
		} catch (IndexOutOfBoundsException e) {

		}
		try {
			jLabelSpecial1.setText(specializ.get(0));
			jLabelSpecial2.setText(specializ.get(1));
		} catch (IndexOutOfBoundsException e) {

		}
		try {
			jLabelLastEduc1.setText(doc.get(0));
			jLabelLastEduc2.setText(doc.get(1) + " " + doc.get(2));
			jLabelLastEduc3.setText(doc.get(3) + " " + doc.get(4));

		} catch (IndexOutOfBoundsException e) {

		}
		
		
		try{
		String s=DateFormat.getDateInstance(DateFormat.LONG, l).format(sd.getDatezdip());
		String [] st= s.split(" ");
		jLabelDay.setText(st[0]);
		jLabelMonth.setText(st[1]);
		jLabelYear.setText(st[2].substring(2, 4));}
		catch (NullPointerException e2) {
            Logger.getLogger(this.getClass()).error("В БД поле Datezdip заполнено неправильно");
		}
		
		String s1=DateFormat.getDateInstance(DateFormat.LONG, l).format(sc.getDateout());
		String [] st1= s1.split(" ");
		jLabelDayOut.setText(st1[0]);
		jLabelMonthOut.setText(st1[1]);
		jLabelYearOut.setText(st1[2].substring(2, 4));
		
		try {
			
			jLabelTimeV.setText(sc.getTimevik());
		} catch (NullPointerException e1) {
		}
		
		if  (!sc.getQualif().startsWith("бакалавр")){
			jLabelTimeVuk.setText ("Час виконання");
			jLabelMarkDiplom.setText("Оцінка");
			jLabelDerzhIsp1.setText("");
			jLabelDerzhIsp2.setText("");
			jLabelDerzhIsp3.setText("");
			jLabelMark1.setText("");
			jLabelMark2.setText("");
			jLabelMark3.setText("");
		}

	}
}
